var log_btn = document.querySelector(".login-btn");
var start_page = document.querySelector(".start");
var login_page = document.querySelector(".login");
var index_page = document.querySelector(".index");
var in_btn = document.querySelector(".in-btn");
var res_btn = document.querySelector(".res-btn");
var res_page = document.querySelector(".register");
var qx = document.querySelectorAll(".qx");
var add = document.querySelector(".add");
var zz = document.querySelector(".zz");
var p_add = document.querySelector(".p-add");
var cancel = document.querySelectorAll(".cancel");
var pro_tg = document.querySelector(".nav-g");
var tg = document.querySelector(".p-tg");
var l_wj = document.querySelector(".l-wj");
var remake = document.querySelector(".remake");
var re_log = document.querySelector(".re-log");
//点击登录
function o_login(){
	log_btn.addEventListener("click",function(){
		start_page.style.display = "none";
		login_page.style.display = "block";
	})
}
//登录
function i_login(){
	in_btn.addEventListener("click",function(){
		login_page.style.display = "none";
		index_page.style.display = "block";
	})
}
//点击注册
function res(){
	res_btn.addEventListener("click",function(){
		start_page.style.display = "none";
		res_page.style.display = "block";
	})
}
//忘记密码，重新设置密码
function remakemm(){
	l_wj.addEventListener("click",function(){
		login_page.style.display = "none";
		remake.style.display = "block";
	})
}
function relog(){
	re_log.addEventListener("click",function(){
		login_page.style.display = "block";
		remake.style.display = "none";
	})
}
//取消
function quxiao(){
	for(let i=0;i<3;i++){
		qx[i].addEventListener("click",function(){
			login_page.style.display = "none";
			res_page.style.display = "none";
			remake.style.display = "none";
			start_page.style.display = "block";
		})
	}
	
}
//点击添加商品
function addpro(){
	add.addEventListener("click",function(){	
		p_add.style.bottom = 0 + "px";
		zz.style.display = "block";
	
	})
}
function canceladd(){
	var clientWidth = document.documentElement.clientWidth;
	cancel[0].addEventListener("click",function(){
		zz.style.display = "none";
//		p_add.style.bottom = -(310/64 * 64 * (clientWidth / 640)) +"px";
		p_add.style.bottom = -(310/64 * (clientWidth / 10)) +"px";
	})
}

//推广===========================
function protg(){
	pro_tg.addEventListener("click",function(){	
		tg.style.bottom = 0 + "px";
		zz.style.display = "block";
	
	})
}
function canceltg(){
	var clientWidth = document.documentElement.clientWidth;
	cancel[1].addEventListener("click",function(){
		zz.style.display = "none";
//		p_add.style.bottom = -(310/64 * 64 * (clientWidth / 640)) +"px";
		tg.style.bottom = -(716/64 * (clientWidth / 10)) +"px";
	})
}
o_login();
i_login();
res();
quxiao();
addpro();
canceladd();
protg();
canceltg();
remakemm();
relog();
